package com.qf.j2112.service.impl;

import com.qf.j2112.mapper.SysEmpMapper;
import com.qf.j2112.po.SysEmp;
import com.qf.j2112.service.SysEmpService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SysEmpServiceImpl implements SysEmpService {

    @Resource
    private SysEmpMapper sysEmpMapper;

    @Override
    public SysEmp findEmpByEname(String ename) {
        return sysEmpMapper.findEmpByEname(ename);
    }

    @Override
    public SysEmp findEmpByEid(int eid) {
        return sysEmpMapper.findEmpByEid(eid);
    }

    @Override
    public List<SysEmp> findAll() {
        return sysEmpMapper.findAll();
    }

    @Override
    public SysEmp addSysEmp(SysEmp emp) {
        sysEmpMapper.addSysEmp(emp);
        return emp;
    }

    @Override
    public Boolean updateSysEmp(SysEmp emp) {
        int i= sysEmpMapper.updateSysEmp(emp);
        if (i>=-1){
            return true;
        }
        return false;
    }

    @Override
    public Boolean deleteSysEmp(int eid) {
        int i=sysEmpMapper.deleteSysEmp(eid);
        if (i>=-1){
            return true;
        }
        return false;
    }
}
